class MyArry{
    public Object[] array = new Object[10];

    public Object getPos(int pos){
        return array[pos];
    }
    public void setVal(int pos,Object val){
        this.array[pos] = val;
    }
}
public class Test {
    public static void main(String[] args){
        MyArry myArry = new MyArry();
        myArry.setVal(0,19);
        myArry.setVal(1,"hello");

        String s = (String) myArry.getPos(1);
        System.out.println(s);
    }
}
